package com.sztx.pay.data.transfer;

import java.io.File;
import java.io.IOException;
import java.util.List;

import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.tools.ant.types.CommandlineJava.SysProperties;

public class CompanyBankTransfer {
	public static void main(String[] args) {
		
		try {
			List<String> list = FileUtils.readLines(new File("E:\\支付分离\\BusinessAuthentication.txt"),"GBK");
			int temp = 0;
			for (String string : list) {
				String[] tmp = string.split("	");
//				String url = "http://cashier.berbon.com/account/bindCard?";
				String cardActType = "null";
				String cardType = "null";
				int num = 146 + temp;
				String bindCardNo = "BC000"+num;
				String sql = "insert into user_bind_card(bind_card_no,user_id,real_name,card_no,card_act_type,card_type,`status`,create_time,bind_type,is_main_card,swift_code,bank_name,card_province,card_city,bank_addr,identity_no,identity_type) VALUES('%s',%s,'%s',%s,2,1,1,'%s',2,0,'%s','%s',%s,%s,'%s','%s',0);";
				String id = tmp[0];
				String userId = tmp[1];
				String companyName = tmp[2];
				String bankName = tmp[3];
				String bankProvince = tmp[4].equals("null") ? tmp[4] : "'" + tmp[4] + "'";
				String bankCity = tmp[5].equals("null") ? tmp[5] : "'" + tmp[5] + "'";
				String bankAcc = tmp[6];
				String bankBranchName = tmp[7];
				String accountName = tmp[8];
				String identityNum = tmp[9];
				String authenticationStatus = tmp[10];
				String bindTime = tmp[11];
				String operatePerson = tmp[12];
				String status = tmp[13];
				String note = tmp[14];
				String createTime = tmp[15];
				String modifyTime = tmp[16];
				String bankCode = tmp[17];
				String bankId = tmp[18];
//				bind_card_no,user_id,real_name,card_no,card_act_type,card_type,`status`,create_time,bind_type,is_main_card,swift_code,bank_name,card_province,card_city,bank_addr,identity_no,identity_type
				String reSql = String.format(sql, bindCardNo,userId,accountName,bankAcc,createTime,bankId,bankName,bankProvince,bankCity,bankBranchName,identityNum);
				System.out.println(reSql);
				for (int i = 0; i < tmp.length; i++) {
//					System.out.print(tmp[i]);
				}
//				System.out.println("");
				
				temp++;
				
			}
			
			
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		
		
	}

}
